﻿using BCDto.Common.ErrorMessage;
using Microsoft.Extensions.DependencyInjection;
using Swashbuckle.AspNetCore.Swagger;
using Swashbuckle.AspNetCore.SwaggerGen;
using System.Collections.Generic;

namespace BCTMSRESTful.Configs
{
    public static class SwaggerExtension
    {
        public static void MapTypes(this SwaggerGenOptions options)
        {
            //options.MapType<IDictionary<string, string>>(() => new Schema
            //{
            //    Title = "Dictionary",
            //    Type = "Dictionary[string, string]",
            //    Example = new
            //    {
            //        Key1 = "string",
            //        Key2 = "string"
            //    }
            //});

            //options.MapType<IDictionary<string, IEnumerable<string>>>(() => new Schema
            //{
            //    Title = "Dictionary",
            //    Type = "Dictionary[string, Array[string]]",
            //    Example = new
            //    {
            //        Key1 = new[] { "string" },
            //        Key2 = new[] { "string" }
            //    }
            //});

            //options.MapType<IDictionary<int, ErrorMessageDto>>(() => new Schema
            //{
            //    Title = "Dictionary",
            //    Type = "Dictionary[integer, ErrorMessageDto]",
            //    Example = new
            //    {
            //        LineId = new ErrorMessageDto()
            //    }
            //});

            //options.MapType<IDictionary<string, IDictionary<string, string>>>(() => new Schema
            //{
            //    Title = "Dictionary",
            //    Type = "Dictionary[string, Dictionary[string, string]]",
            //    Example = new
            //    {
            //        Key1 = new
            //        {
            //            Key1 = "string",
            //            Key2 = "string"
            //        },
            //        Key2 = new
            //        {
            //            Key1 = "string",
            //            Key2 = "string"
            //        }
            //    }
            //});

            //options.MapType<IDictionary<string, decimal>>(() => new Schema
            //{
            //    Title = "Dictionary",
            //    Type = "Dictionary[string, number]",
            //    Example = new
            //    {
            //        Key1 = 0.00,
            //        Key2 = 0.00
            //    }
            //});
        }
    }
}
